@zonos/elements 1.3.171 → 1.3.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{CheckoutConfig-f5e68e14.js → CheckoutConfig-c5943bbf.js} +1 -1
- package/dist/cjs/{cart-36799bbe.js → cart-d9052930.js} +21 -8
- package/dist/cjs/{handleFetch-7b7f9f7c.js → handleFetch-ff25db40.js} +10 -6
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-3eae38bd.js → paypal-31477331.js} +6 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +61 -19
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +20 -12
- package/dist/cjs/zonos-checkout.cjs.entry.js +106 -36
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +20 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +10 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +114 -37
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +10 -6
- package/dist/collection/components/store/checkout/cart.js +5 -0
- package/dist/collection/components/store/checkout/paypal.js +5 -0
- package/dist/collection/components/store/checkout/stripe.js +12 -7
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +37 -16
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +27 -4
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +22 -2
- package/dist/collection/components/utils/api/trackConversionEvent.js +1 -0
- package/dist/collection/components/utils/handleFetch.js +9 -6
- package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +1 -0
- package/dist/collection/styles/stripe/defaultVariable.js +2 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
- package/dist/collection/types/generated/graphql.internal.types.js +16 -0
- package/dist/esm/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
- package/dist/esm/{cart-b2e57589.js → cart-fff4f4a4.js} +21 -8
- package/dist/esm/{handleFetch-8d72c8cd.js → handleFetch-0109fb78.js} +10 -6
- package/dist/esm/index.js +10 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-38da5d52.js → paypal-087fbd16.js} +6 -2
- package/dist/esm/zonos-address_7.entry.js +61 -19
- package/dist/esm/zonos-cart-items_13.entry.js +20 -12
- package/dist/esm/zonos-checkout.entry.js +106 -36
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +20 -4
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
- package/dist/esm-es5/{cart-b2e57589.js → cart-fff4f4a4.js} +1 -1
- package/dist/esm-es5/handleFetch-0109fb78.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-38da5d52.js → paypal-087fbd16.js} +2 -2
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +26 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +17 -3
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +4 -0
- package/dist/types/components/store/checkout/stripe.d.ts +10 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +6 -2
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +1 -1
- package/dist/types/components/stripe/zonos-payment/zonos-payment.d.ts +3 -0
- package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +1 -0
- package/dist/types/components.d.ts +8 -6
- package/dist/types/types/ConversionEvent.d.ts +2 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +92 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +106 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +124 -0
- package/dist/types/types/generated/graphql.internal.types.ts +154 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-0bfca3a9.system.entry.js → p-0078362c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-033817e3.system.entry.js +1 -0
- package/dist/zonos-elements/p-04c38987.system.js +1 -0
- package/dist/zonos-elements/{p-cb52cfdf.entry.js → p-0db19b02.entry.js} +1 -1
- package/dist/zonos-elements/p-1b5a2714.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1edbfb1f.system.entry.js → p-1be7b435.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-47f79a6d.js → p-1c488ecf.js} +1 -1
- package/dist/zonos-elements/{p-c5c2976f.system.js → p-2ebb4fa7.system.js} +1 -1
- package/dist/zonos-elements/{p-1a20922f.system.entry.js → p-31ce9143.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3888f1d.system.js → p-38f6f6fd.system.js} +1 -1
- package/dist/zonos-elements/{p-b0c39400.entry.js → p-407a96d2.entry.js} +1 -1
- package/dist/zonos-elements/p-427c2766.entry.js +1 -0
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
- package/dist/zonos-elements/{p-0def1397.system.entry.js → p-514431e9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5275b7ca.system.entry.js +1 -0
- package/dist/zonos-elements/p-5edc11be.system.entry.js +1 -0
- package/dist/zonos-elements/{p-461ca324.entry.js → p-67ca7373.entry.js} +1 -1
- package/dist/zonos-elements/{p-864c7c7d.entry.js → p-73a7b89b.entry.js} +1 -1
- package/dist/zonos-elements/{p-ecd4ec15.system.js → p-759a654a.system.js} +1 -1
- package/dist/zonos-elements/{p-bfa028a2.entry.js → p-7862da71.entry.js} +1 -1
- package/dist/zonos-elements/p-78b81404.system.js +17 -0
- package/dist/zonos-elements/p-839448c3.js +1 -0
- package/dist/zonos-elements/p-8b33c3b7.entry.js +1 -0
- package/dist/zonos-elements/{p-56a8b1f6.system.entry.js → p-a83370c6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ff1c6d9a.entry.js → p-a9d7746a.entry.js} +1 -1
- package/dist/zonos-elements/{p-c82f488b.system.entry.js → p-ada6e691.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-dd0259f4.js → p-bfd6e156.js} +1 -1
- package/dist/zonos-elements/p-cbd2bd33.js +17 -0
- package/dist/zonos-elements/p-ef9fdf45.entry.js +1 -0
- package/dist/zonos-elements/p-f6c0da8b.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-8d72c8cd.js +0 -1
- package/dist/zonos-elements/p-00ad3c73.entry.js +0 -1
- package/dist/zonos-elements/p-173d1fcd.system.entry.js +0 -1
- package/dist/zonos-elements/p-48173901.js +0 -17
- package/dist/zonos-elements/p-53cb8867.system.entry.js +0 -1
- package/dist/zonos-elements/p-56758218.system.entry.js +0 -1
- package/dist/zonos-elements/p-71539c8a.js +0 -1
- package/dist/zonos-elements/p-9261869c.system.js +0 -1
- package/dist/zonos-elements/p-934164df.entry.js +0 -1
- package/dist/zonos-elements/p-9f9e4f74.entry.js +0 -1
- package/dist/zonos-elements/p-bf113a46.system.js +0 -17
- package/dist/zonos-elements/p-e09cea9c.entry.js +0 -1
- package/dist/zonos-elements/p-fd352222.system.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
4
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
5
5
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
6
6
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
7
7
|
|
|
@@ -10709,6 +10709,7 @@ const trackConversionEvent = async (eventName, metadata) => {
|
|
|
10709
10709
|
const body = {
|
|
10710
10710
|
checkoutSessionId,
|
|
10711
10711
|
countryCode,
|
|
10712
|
+
eventCreated: Date.now(),
|
|
10712
10713
|
eventName,
|
|
10713
10714
|
metadata,
|
|
10714
10715
|
organizationId,
|
|
@@ -10942,6 +10943,8 @@ const defaultVariable = ({ borderStyle, theme, }) => {
|
|
|
10942
10943
|
default:
|
|
10943
10944
|
return {
|
|
10944
10945
|
borderRadius: getBorderRadius.getBorderRadius({ overrideBorderStyle: borderStyle }),
|
|
10946
|
+
iconMenuColor: 'var(--colorText)',
|
|
10947
|
+
iconMenuHoverColor: 'var(--colorText)',
|
|
10945
10948
|
};
|
|
10946
10949
|
}
|
|
10947
10950
|
};
|
|
@@ -10951,6 +10954,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = zonosStore
|
|
|
10951
10954
|
clientSecret: sessionStorage.getItem('zonos--client-secret') || '',
|
|
10952
10955
|
companyName: '',
|
|
10953
10956
|
customErrorMessage: null,
|
|
10957
|
+
customerProfile: null,
|
|
10954
10958
|
fetchingLandedCostAbortController: null,
|
|
10955
10959
|
hasPaymentError: false,
|
|
10956
10960
|
isFetchingLandedCost: false,
|
|
@@ -10973,6 +10977,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = zonosStore
|
|
|
10973
10977
|
stripeBillingAddressEventData: null,
|
|
10974
10978
|
stripeBillingAddressUsedWhenFetchingLC: null,
|
|
10975
10979
|
stripeBillingAddressUsedWhenValidatingAddress: null,
|
|
10980
|
+
stripeCustomerSessionClientSecret: null,
|
|
10976
10981
|
stripeElements: null,
|
|
10977
10982
|
stripeElementsForBillingAddress: null,
|
|
10978
10983
|
stripeElementsOptions: null,
|
|
@@ -11014,6 +11019,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
11014
11019
|
},
|
|
11015
11020
|
// Client secret can be undefined since we will load other elements that doesn't require client secret first, then load client secret and render one that requires it later
|
|
11016
11021
|
clientSecret: clientSecret || undefined,
|
|
11022
|
+
customerSessionClientSecret: stripeStore.stripeCustomerSessionClientSecret || undefined,
|
|
11017
11023
|
externalPaymentMethodTypes: [...paypalPaymentType],
|
|
11018
11024
|
locale: localizationStore.selectedLocale,
|
|
11019
11025
|
};
|
|
@@ -11143,6 +11149,10 @@ const stripeCalculateLandedCost = async () => {
|
|
|
11143
11149
|
}
|
|
11144
11150
|
return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
|
|
11145
11151
|
}).filter(Boolean)) || [];
|
|
11152
|
+
// Send event when we get the quote back after the customer clicked "Continue to shipping"
|
|
11153
|
+
if (checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.length) {
|
|
11154
|
+
void trackConversionEvent('checkout_quoteReceived');
|
|
11155
|
+
}
|
|
11146
11156
|
// update adjustmentTotal
|
|
11147
11157
|
// highlight promocode input error if promocode is applied but no adjustment applied in landed cost
|
|
11148
11158
|
const isInvalidPromoCode = cartStore.promoCodeApplied &&
|
|
@@ -11443,6 +11453,9 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
11443
11453
|
paymentMethod: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.payment_method,
|
|
11444
11454
|
});
|
|
11445
11455
|
handleFetch.log('Payment intent confirmed', 'info', { error, paymentIntent });
|
|
11456
|
+
if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === 'requires_action') {
|
|
11457
|
+
throw new Error(translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'));
|
|
11458
|
+
}
|
|
11446
11459
|
if (error) {
|
|
11447
11460
|
if (error.type === 'card_error' || error.type === 'validation_error') {
|
|
11448
11461
|
throw new Error(error.message);
|
|
@@ -11469,6 +11482,7 @@ const getCheckoutSessionBody = () => {
|
|
|
11469
11482
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
11470
11483
|
cartId: window.Zonos.cartId,
|
|
11471
11484
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
11485
|
+
customerAuthenticationToken: cartStore.customerAuthenticationToken || undefined,
|
|
11472
11486
|
itemsAmount: total,
|
|
11473
11487
|
metadata: [
|
|
11474
11488
|
{
|
|
@@ -11495,10 +11509,6 @@ const getCheckoutSessionBody = () => {
|
|
|
11495
11509
|
};
|
|
11496
11510
|
const stripeStoreGetPaymentIntent = async () => {
|
|
11497
11511
|
var _a;
|
|
11498
|
-
if (stripeStore.clientSecret) {
|
|
11499
|
-
handleFetch.log('Payment intent already exists, skipping fetching payment intent');
|
|
11500
|
-
return;
|
|
11501
|
-
}
|
|
11502
11512
|
if (!cartStore.checkoutSessionId) {
|
|
11503
11513
|
// We want to log the error anytime we fail to create a checkout session
|
|
11504
11514
|
void handleFetch.sendErrorLog({
|
|
@@ -11545,9 +11555,6 @@ const stripeStoreGetPaymentIntent = async () => {
|
|
|
11545
11555
|
});
|
|
11546
11556
|
return;
|
|
11547
11557
|
}
|
|
11548
|
-
// update stripe store with updated information
|
|
11549
|
-
stripeStore.clientSecret =
|
|
11550
|
-
json.checkoutSessionPaymentIntentCreate.clientSecret;
|
|
11551
11558
|
// update cart store checkout session with updated from checkout session payment intent creation call so the checkout session and payment intent are in sync
|
|
11552
11559
|
cartStoreSetCheckoutSession(json.checkoutSessionPaymentIntentCreate);
|
|
11553
11560
|
};
|
|
@@ -11624,6 +11631,7 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
|
|
|
11624
11631
|
adjustmentsAmount,
|
|
11625
11632
|
cartId,
|
|
11626
11633
|
currency,
|
|
11634
|
+
customerAuthenticationToken: cartStore.customerAuthenticationToken || undefined,
|
|
11627
11635
|
id,
|
|
11628
11636
|
itemsAmount,
|
|
11629
11637
|
landedCostId,
|
|
@@ -11794,6 +11802,7 @@ const { onChange, reset, state: cartStore, } = zonosStore.createStore(() => ({
|
|
|
11794
11802
|
checkoutTimeoutInterval: null,
|
|
11795
11803
|
currency: 'USD',
|
|
11796
11804
|
customQuotingError: null,
|
|
11805
|
+
customerAuthenticationToken: null,
|
|
11797
11806
|
displayBaseCurrency: false,
|
|
11798
11807
|
dutiesTaxesFees: null,
|
|
11799
11808
|
dutiesTaxesFeesEstimate: null,
|
|
@@ -11946,7 +11955,11 @@ const cartStoreHasOneEligibleItem = () => {
|
|
|
11946
11955
|
};
|
|
11947
11956
|
const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
11948
11957
|
var _a, _b, _c, _d, _e;
|
|
11958
|
+
// update stripe store with updated information
|
|
11949
11959
|
stripeStore.clientSecret = checkoutSession.clientSecret;
|
|
11960
|
+
stripeStore.stripeCustomerSessionClientSecret =
|
|
11961
|
+
checkoutSession.customerSessionClientSecret;
|
|
11962
|
+
stripeStore.customerProfile = checkoutSession.customerProfile;
|
|
11950
11963
|
cartStore.checkoutSession = checkoutSession;
|
|
11951
11964
|
cartStore.checkoutSessionId = checkoutSession.id;
|
|
11952
11965
|
// Check if there is a redirect URL in the metadata to override
|
|
@@ -154,6 +154,7 @@ const getAdditionalLogMetadata = () => {
|
|
|
154
154
|
connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
|
|
155
155
|
connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
|
|
156
156
|
connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
|
|
157
|
+
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
157
158
|
screenHeight: window.screen.height,
|
|
158
159
|
screenWidth: window.screen.width,
|
|
159
160
|
userAgent: userAgentData && userAgentData.brands.length > 0
|
|
@@ -400,12 +401,15 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
|
|
|
400
401
|
log(`${path} (${duration.toFixed(2)}ms)`, 'info');
|
|
401
402
|
// No need to send the load time api log for the log-script-load endpoint
|
|
402
403
|
const internalDuration = response === null || response === void 0 ? void 0 : response.headers.get('Zonos-Duration');
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
// Only record if the response status is 200, some endpoint will return 200 with error
|
|
405
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 200) {
|
|
406
|
+
prepLoadTimeApiLog({
|
|
407
|
+
apiPath: path,
|
|
408
|
+
apiType: basePathType,
|
|
409
|
+
loadTimeInternal: internalDuration ? Number(internalDuration) : 0,
|
|
410
|
+
loadTimeTotal: duration,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
409
413
|
const nextFallbackApiType = getNextFallbackApiType(basePathType);
|
|
410
414
|
const unknownError = errors.find(({ type }) => type === 'unknown');
|
|
411
415
|
const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
6
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
5
|
+
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
6
|
+
const CheckoutConfig = require('./CheckoutConfig-c5943bbf.js');
|
|
7
7
|
const TaxId = require('./TaxId-4632639d.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
132
|
-
const cdnUrl = "https://v1.3.
|
|
132
|
+
const cdnUrl = "https://v1.3.173.js.zonos.com";
|
|
133
133
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
134
134
|
if (!qaUrl &&
|
|
135
135
|
(cdnUrl.includes('test.') ||
|
|
@@ -313,10 +313,10 @@ const zonosLoadUrl = (() => {
|
|
|
313
313
|
}
|
|
314
314
|
return null;
|
|
315
315
|
})();
|
|
316
|
-
const ZONOS_URL = "https://v1.3.
|
|
317
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
318
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
319
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
316
|
+
const ZONOS_URL = "https://v1.3.173.js.zonos.com";
|
|
317
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.173";
|
|
318
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.173";
|
|
319
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.173";
|
|
320
320
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
321
321
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
322
322
|
class Zonos {
|
|
@@ -330,7 +330,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
330
330
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
331
331
|
Zonos._paypalMockResponse = null;
|
|
332
332
|
Zonos.isBigCommerce = false;
|
|
333
|
-
Zonos.releaseDate = "
|
|
333
|
+
Zonos.releaseDate = "1742573632605";
|
|
334
334
|
Zonos.isLegacyCheckout = false;
|
|
335
335
|
Zonos.domain = typeof window !== 'undefined'
|
|
336
336
|
? // domain that embeds the iframe
|
|
@@ -346,7 +346,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
346
346
|
Zonos.isNpm = true;
|
|
347
347
|
Zonos.zonosQaUrl = null;
|
|
348
348
|
Zonos.zonosQaUrlApi = null;
|
|
349
|
-
Zonos.version = `v${"1.3.
|
|
349
|
+
Zonos.version = `v${"1.3.173"}`;
|
|
350
350
|
Zonos.modeAlerted = false;
|
|
351
351
|
Zonos.cartData = null;
|
|
352
352
|
Zonos.paypal = null;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy(JSON.parse("[[\"zonos-checkout.cjs\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello.cjs\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller.cjs\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip.cjs\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component.cjs\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link.cjs\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo.cjs\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog.cjs\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge.cjs\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio.cjs\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle.cjs\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse.cjs\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-stripe-input.cjs\",[[1,\"zonos-stripe-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-card.cjs\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input.cjs\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-text.cjs\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-banner.cjs\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag.cjs\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack.cjs\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4.cjs\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32]},null,{\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-button_3.cjs\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"bold\":[4],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2.cjs\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4.cjs\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7.cjs\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13.cjs\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"isTaxIdError\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
11
|
+
return index.bootstrapLazy(JSON.parse("[[\"zonos-checkout.cjs\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"defaultCustomerProfileAddress\":[32],\"customerProfile\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"stripeCustomerSessionClientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"customerProfile\":[\"handleCustomerProfileChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"stripeCustomerSessionClientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello.cjs\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller.cjs\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip.cjs\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component.cjs\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link.cjs\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo.cjs\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog.cjs\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge.cjs\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio.cjs\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle.cjs\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse.cjs\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-stripe-input.cjs\",[[1,\"zonos-stripe-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-card.cjs\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input.cjs\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-text.cjs\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-banner.cjs\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag.cjs\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack.cjs\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4.cjs\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32],\"isPaymentInfoFilled\":[32]},null,{\"isPaymentInfoFilled\":[\"watchIsPaymentInfoFilled\"],\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-button_3.cjs\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"bold\":[4],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2.cjs\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4.cjs\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7.cjs\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13.cjs\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"isTaxIdError\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const cart = require('./cart-d9052930.js');
|
|
5
|
+
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
7
7
|
|
|
8
8
|
/*!
|
|
@@ -311,6 +311,10 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
311
311
|
});
|
|
312
312
|
return {
|
|
313
313
|
createOrder: async () => {
|
|
314
|
+
// Clicking on the paypal button should trigger the paymentInfoCompleted event
|
|
315
|
+
void cart.trackConversionEvent('checkout_paymentInfoCompleted', {
|
|
316
|
+
paymentMethod: 'paypal',
|
|
317
|
+
});
|
|
314
318
|
const checkoutSessionStatus = await cart.validateCheckoutSession();
|
|
315
319
|
if (!checkoutSessionStatus.valid) {
|
|
316
320
|
paypalStore.paypalErrorMessage = checkoutSessionStatus.errorMessage;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-d9052930.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
8
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
9
|
+
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
10
10
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
11
11
|
const classes = require('./classes-b7918f56.js');
|
|
12
12
|
const RemoveIcon$1 = require('./RemoveIcon-081ac073.js');
|
|
@@ -24,9 +24,13 @@ const ZonosAddress = class {
|
|
|
24
24
|
* Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
|
|
25
25
|
*/
|
|
26
26
|
this.isAutoCompleteAdjusted = false;
|
|
27
|
+
/**
|
|
28
|
+
* Check if the tracking event is sent
|
|
29
|
+
*/
|
|
30
|
+
this.trackingSent = false;
|
|
27
31
|
this.type = undefined;
|
|
28
32
|
this.titleText = undefined;
|
|
29
|
-
this.defaultAddress =
|
|
33
|
+
this.defaultAddress = [];
|
|
30
34
|
this.stripe = window.Zonos.stripe;
|
|
31
35
|
this.isDirtyAddress = false;
|
|
32
36
|
}
|
|
@@ -49,9 +53,14 @@ const ZonosAddress = class {
|
|
|
49
53
|
case 'billing':
|
|
50
54
|
cart.stripeStore.stripeBillingAddressEventData = event;
|
|
51
55
|
break;
|
|
52
|
-
default:
|
|
56
|
+
default: {
|
|
57
|
+
if (event.complete && !this.trackingSent) {
|
|
58
|
+
void cart.trackConversionEvent('checkout_customerInfoFilled');
|
|
59
|
+
this.trackingSent = true;
|
|
60
|
+
}
|
|
53
61
|
cart.stripeStore.stripeAddressEventData = event;
|
|
54
62
|
break;
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
updateAddressElement({ stripeAddressElement, type, }) {
|
|
@@ -62,19 +71,15 @@ const ZonosAddress = class {
|
|
|
62
71
|
cart.stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
63
72
|
}
|
|
64
73
|
async watchInitStripe() {
|
|
65
|
-
var _a, _b;
|
|
66
74
|
this.stripe = window.Zonos.stripe;
|
|
67
75
|
const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
|
|
68
76
|
if (!this.stripe || !stripeElements) {
|
|
69
77
|
handleFetch.logError("Stripe is not initialized. Couldn't load stripe element.");
|
|
70
78
|
return;
|
|
71
79
|
}
|
|
72
|
-
|
|
73
|
-
if
|
|
74
|
-
|
|
75
|
-
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
76
|
-
(_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
|
|
77
|
-
}
|
|
80
|
+
// remove phone from default address if it's not provided, stripe
|
|
81
|
+
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
82
|
+
const defaultAddress = this.defaultAddress.map(address => (Object.assign(Object.assign({}, address), { name: address.name, phone: address.phone || undefined })));
|
|
78
83
|
const shippableCountries = cart.localizationStore.shippingZoneCountries;
|
|
79
84
|
const shippingZone = shippableCountries
|
|
80
85
|
? Object.values(shippableCountries).map(country => country.code)
|
|
@@ -88,8 +93,8 @@ const ZonosAddress = class {
|
|
|
88
93
|
const addressElement = stripeElements.create('address', {
|
|
89
94
|
allowedCountries: checkoutAllCountries ? [] : allowedCountries,
|
|
90
95
|
// only show the default address if stripeAddressEventData is not provided
|
|
91
|
-
contacts:
|
|
92
|
-
?
|
|
96
|
+
contacts: defaultAddress.length && !stripeAddressEventData
|
|
97
|
+
? this.defaultAddress
|
|
93
98
|
: [],
|
|
94
99
|
defaultValues: {
|
|
95
100
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
@@ -147,12 +152,27 @@ const ZonosAddress = class {
|
|
|
147
152
|
type: this.type,
|
|
148
153
|
});
|
|
149
154
|
}
|
|
150
|
-
defaultAddressChanged() {
|
|
155
|
+
defaultAddressChanged(oldAddress, newAddress) {
|
|
156
|
+
// check if stringified json of oldAddress is different from newAddress
|
|
157
|
+
const oldAddressString = JSON.stringify(oldAddress);
|
|
158
|
+
const newAddressString = JSON.stringify(newAddress);
|
|
159
|
+
// No need to reset address element if the default address is the same
|
|
160
|
+
if (oldAddressString === newAddressString) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
151
163
|
handleFetch.log('Reset address element when default address property is changed', 'info', {
|
|
152
164
|
defaultAddress: this.defaultAddress,
|
|
153
165
|
});
|
|
154
166
|
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
167
|
+
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.clear();
|
|
155
168
|
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
169
|
+
// Reset stripe address event data
|
|
170
|
+
if (this.type === 'shipping') {
|
|
171
|
+
cart.stripeStore.stripeAddressEventData = null;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
cart.stripeStore.stripeBillingAddressEventData = null;
|
|
175
|
+
}
|
|
156
176
|
void this.watchInitStripe();
|
|
157
177
|
}
|
|
158
178
|
renderCompanyNameInput() {
|
|
@@ -186,7 +206,7 @@ const ZonosAddress = class {
|
|
|
186
206
|
}
|
|
187
207
|
render() {
|
|
188
208
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
189
|
-
return (index.h(index.Host, { key: '
|
|
209
|
+
return (index.h(index.Host, { key: '9fd8e0ac4b86c10004c24e9d33f40ec577bd2a73', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: 'e7c3cbcab6f175354f26a8426d0dbf01afca736d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), index.h("div", { key: '48ccbb019255c5362adf4c7954a7c2e3b015bfa5', class: "zonos--address-component" })));
|
|
190
210
|
}
|
|
191
211
|
get el() { return index.getElement(this); }
|
|
192
212
|
static get watchers() { return {
|
|
@@ -634,7 +654,7 @@ const ZonosLinkAuthentication = class {
|
|
|
634
654
|
// Create and mount the Authentication Element in ${type} mode
|
|
635
655
|
const linkAuthenticationElement = cart.stripeStore.stripeLinkElement ||
|
|
636
656
|
cart.stripeStore.stripeElements.create('linkAuthentication', {
|
|
637
|
-
defaultValues: defaultValues
|
|
657
|
+
defaultValues: defaultValues,
|
|
638
658
|
});
|
|
639
659
|
const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
|
|
640
660
|
if (!linkAuthenticationElementContainer) {
|
|
@@ -649,11 +669,33 @@ const ZonosLinkAuthentication = class {
|
|
|
649
669
|
});
|
|
650
670
|
cart.stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
651
671
|
}
|
|
652
|
-
watchDefaultEmail() {
|
|
653
|
-
|
|
672
|
+
watchDefaultEmail(newDefaultEmail, oldDefaultEmail) {
|
|
673
|
+
var _a, _b;
|
|
674
|
+
handleFetch.log('Default email is changed', 'info', {
|
|
675
|
+
newDefaultEmail,
|
|
676
|
+
oldDefaultEmail,
|
|
677
|
+
});
|
|
678
|
+
if (oldDefaultEmail === newDefaultEmail) {
|
|
654
679
|
return;
|
|
655
680
|
}
|
|
656
|
-
|
|
681
|
+
if (!newDefaultEmail) {
|
|
682
|
+
cart.stripeStore.stripeLinkEventData = null;
|
|
683
|
+
}
|
|
684
|
+
// Only set value for Stripe input input to stripeLinkEventData when checkout is in staging mode
|
|
685
|
+
if (cart.cartStore.isStagingMode) {
|
|
686
|
+
this.setCustomEmailInputToLinkEvent(newDefaultEmail || '');
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
(_a = cart.stripeStore.stripeLinkElement) === null || _a === void 0 ? void 0 : _a.clear();
|
|
690
|
+
(_b = cart.stripeStore.stripeLinkElement) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
691
|
+
cart.stripeStore.stripeLinkElement = null;
|
|
692
|
+
cart.stripeStore.stripeLinkEventData = null;
|
|
693
|
+
handleFetch.log('Reset stripe link element when default email is changed', 'info', {
|
|
694
|
+
defaultEmail: newDefaultEmail,
|
|
695
|
+
});
|
|
696
|
+
setTimeout(() => {
|
|
697
|
+
void this.watchInitStripe();
|
|
698
|
+
}, 5);
|
|
657
699
|
}
|
|
658
700
|
componentDidLoad() {
|
|
659
701
|
// @Watch doesn't get trigger on initial load
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-d9052930.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-31477331.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
10
|
-
const handleFetch = require('./handleFetch-
|
|
10
|
+
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
11
11
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
12
12
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -1487,9 +1487,10 @@ const ZonosCheckoutFinish = class {
|
|
|
1487
1487
|
clientSecret,
|
|
1488
1488
|
storybookForceStatus: this.storybookForceStatus,
|
|
1489
1489
|
});
|
|
1490
|
-
|
|
1490
|
+
const isError = status === 'requires_action' || error;
|
|
1491
|
+
this.notificationType = isError ? 'error' : 'success';
|
|
1491
1492
|
this.notificationMessages = messages || [];
|
|
1492
|
-
this.notificationTitle =
|
|
1493
|
+
this.notificationTitle = isError
|
|
1493
1494
|
? cart.translate('Payment failed')
|
|
1494
1495
|
: cart.translate("You're all set!");
|
|
1495
1496
|
handleFetch.log('=== Payment intent retrieve status', 'info', {
|
|
@@ -1566,6 +1567,9 @@ const ZonosCheckoutFinish = class {
|
|
|
1566
1567
|
// show success message right away when order id is already created
|
|
1567
1568
|
this.isLoading = false;
|
|
1568
1569
|
if (paypal.paypalStore.orderIdCreated) {
|
|
1570
|
+
paypal.submitGtag('zonos-checkout-success');
|
|
1571
|
+
// Make sure to send the event when order is completed
|
|
1572
|
+
await cart.trackConversionEvent('checkout_orderCompleted');
|
|
1569
1573
|
this.notificationType = 'success';
|
|
1570
1574
|
this.notificationTitle = cart.translate("You're all set!");
|
|
1571
1575
|
this.notificationMessages =
|
|
@@ -1632,11 +1636,11 @@ const ZonosCheckoutFinish = class {
|
|
|
1632
1636
|
}
|
|
1633
1637
|
render() {
|
|
1634
1638
|
const isTestMode = handleFetch.getIsTestMode();
|
|
1635
|
-
return (index.h(index.Host, { key: '
|
|
1639
|
+
return (index.h(index.Host, { key: '4bb26161ad400a7bbd7b7e9f0568ac5de8f18004', class: "zonos--checkout-finish zonos--elements", style: {
|
|
1636
1640
|
'--zonos--border-radius': getBorderRadius.getBorderRadius({
|
|
1637
1641
|
overrideBorderStyle: this.borderRadius,
|
|
1638
1642
|
}),
|
|
1639
|
-
} }, !this.isLoading && (index.h("div", { key: '
|
|
1643
|
+
} }, !this.isLoading && (index.h("div", { key: '85d3bf11c73dfd2b18d0a6d996f2c1f4a01a2288', class: "zonos--finish-details" }, index.h("div", { key: '0e4fb2b7cd03a4464dde3cce69932b8482da0d02', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '0ced9d9d83576979ae785be52c0ae07dca0fd5de', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: 'd14a6fbe02dc836512b41859cc8de573653c4884', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: '5a80853fd1374fc72ccc2b416b62f6c52e4916dd',
|
|
1640
1644
|
// Only show loading spinner if it's not an error notification
|
|
1641
1645
|
loading: this.isWaitingToRedirect &&
|
|
1642
1646
|
this.notificationType !== 'error', onClick: () => {
|
|
@@ -1648,9 +1652,9 @@ const ZonosCheckoutFinish = class {
|
|
|
1648
1652
|
}
|
|
1649
1653
|
this.closeClickHandler();
|
|
1650
1654
|
}, size: "md", variant: "primary" }, cart.translate('Close'))), !window.Zonos.isLegacyCheckout &&
|
|
1651
|
-
this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: '
|
|
1655
|
+
this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: 'ba2fca63de8f04c76fa4d1bc96d06863fbad78cf', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
|
|
1652
1656
|
cart.cartStore.step === 'finish' &&
|
|
1653
|
-
this.notificationType === 'success' && (index.h("div", { key: '
|
|
1657
|
+
this.notificationType === 'success' && (index.h("div", { key: '1e3cb2f2f5874b93886247af585566dbaad9a45f', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'f8603ae4e116da9f8adabe648a6f626b994f208a', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: '91df622529ff650464b3694780e65d2d929548f9', onClick: () => {
|
|
1654
1658
|
const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
|
|
1655
1659
|
this.redirectToUrl(isZonosDashboard
|
|
1656
1660
|
? '/orders/all'
|
|
@@ -2339,7 +2343,7 @@ const ZonosCustomerInfo = class {
|
|
|
2339
2343
|
this.submitBtnType = undefined;
|
|
2340
2344
|
this.submitBtnColor = undefined;
|
|
2341
2345
|
this.isMobile = false;
|
|
2342
|
-
this.defaultAddress =
|
|
2346
|
+
this.defaultAddress = [];
|
|
2343
2347
|
this.showErrorBanner = false;
|
|
2344
2348
|
this.shippingCountry = '';
|
|
2345
2349
|
this.isCheckingForRestrictedItems = false;
|
|
@@ -2396,7 +2400,7 @@ const ZonosCustomerInfo = class {
|
|
|
2396
2400
|
} }), this.isTaxIdError && (index.h("zonos-text", { textColor: 'red-600', type: "caption" }, cart.translate('Tax id is required')))));
|
|
2397
2401
|
}
|
|
2398
2402
|
render() {
|
|
2399
|
-
var _a, _b;
|
|
2403
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2400
2404
|
if (!cart.stripeStore.stripeElements) {
|
|
2401
2405
|
return null;
|
|
2402
2406
|
}
|
|
@@ -2415,11 +2419,15 @@ const ZonosCustomerInfo = class {
|
|
|
2415
2419
|
const showBilling = !cart.stripeStore.stripeShippingSameAsBilling;
|
|
2416
2420
|
// Get theme for the update dialog, inherit from the theme, no from this component theme
|
|
2417
2421
|
const theme = zonosStore.getZonosStoreTheme(zonosStore.zonosStore.appearance.theme);
|
|
2422
|
+
// Attempt to get the email from email from customer profile's locations, if not provided, just use the email from root customer profile
|
|
2423
|
+
const defaultEmail = ((_b = this.defaultAddress.find(Boolean)) === null || _b === void 0 ? void 0 : _b.email) ||
|
|
2424
|
+
((_e = (_d = (_c = cart.stripeStore.customerProfile) === null || _c === void 0 ? void 0 : _c.locations) === null || _d === void 0 ? void 0 : _d.find(Boolean)) === null || _e === void 0 ? void 0 : _e.email) ||
|
|
2425
|
+
((_f = cart.stripeStore.customerProfile) === null || _f === void 0 ? void 0 : _f.email);
|
|
2418
2426
|
// start validate on typing after error banner is shown, and hide it if the form is complete
|
|
2419
2427
|
if (this.showErrorBanner) {
|
|
2420
2428
|
this.showErrorBanner = !this.handleValidate();
|
|
2421
2429
|
}
|
|
2422
|
-
return (index.h(index.Host, { class: "zonos--customer-info zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Customer information')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), index.h("zonos-link-authentication", { defaultEmail:
|
|
2430
|
+
return (index.h(index.Host, { class: "zonos--customer-info zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Customer information')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), index.h("zonos-link-authentication", { defaultEmail: defaultEmail, isEmailError: this.isEmailError, onLinkAuthenticationChange: this.handleEmailValidation, titleText: cart.translate('Contact') }), index.h("zonos-address", { defaultAddress: this.defaultAddress, titleText: cart.translate('Address'), type: "shipping" }), this.renderTaxIdInput(this.shippingCountry), index.h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: cart.stripeStore.stripeShippingSameAsBilling, label: cart.translate('Shipping address same as billing'), onCheckboxSelected: e => {
|
|
2423
2431
|
cart.stripeStore.stripeShippingSameAsBilling = e.detail;
|
|
2424
2432
|
} }), index.h("zonos-collapse", { collapsed: !showBilling }, index.h("zonos-address", { defaultAddress: this.defaultAddress, titleText: cart.translate('Billing address'), type: "billing" })), index.h("div", { class: "zonos--group-btn" }, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
2425
2433
|
// use primary type when on mobile mode
|